#include<func.h>
#include <netdb.h>
int main(int argc,char*argv[])
{
    //./getIP.c  www.baidu.com
    ARGS_CHECK(argc,2);
    struct hostent *phost = gethostbyname(argv[1]);
    if(phost == NULL)
    {
        herror("gethostbyname");
        return -1;
    }
    printf("official name = %s\n",phost->h_name); //真实ip名字
    for(int i =0; phost->h_aliases[i]!=NULL;++i)
    {
        printf("alias name =%s\n",phost->h_aliases[i]);
    }
    return 0;
}
